<template>
	<view>
	  <view class="topicon">
	    <image src="https://ayh.wissun.net/static/ayh/dqd/logo.png" mode="widthFix"/>
	  </view>
	  <view class="userinfobb">
	     <view class="tpddiv">
	          <view class="logopng">
	            <image src="https://ayh.wissun.net/static/ayh/dqd/moren.png" mode="widthFix" />
	        </view>
	        <view class="rihname">
	            <view class="mmname">Hi,{{userinfo.nickname}}</view>
	            <view class="tagname">
					<view>角色：</view>
					<view v-if="userinfo.role == 0">总仓管理员</view>
					<view v-if="userinfo.role == 1">省代</view>
					<view v-if="userinfo.role == 2">经销商</view>
					<view v-if="userinfo.role == 3">分销商</view>
					<view v-if="userinfo.role == 4">门店</view>
	            </view> 
	        </view>
	     </view>
	     <view class="chkupp">
	        <view class="chukunum">
	            <view class="font16">0</view>
	            <view class="font14">出库次数</view>
	        </view>
	        <view class="uyy">
	            <view class="font16">0</view>
	            <view class="font14">入库次数</view>
	        </view>
	     </view>
	     <view class="logintime" >账户编号：{{userinfo.user_code}}</view>
	  </view>
	
	  <view class="patitle">
	    <view class="title">常用工具</view>
	    <view class="naviconlist">
	        <view class="navitem" @click="wangdianss()" >
	          <image src="https://ayh.wissun.net/static/ayh/dqd/wdinfo.png" mode="widthFix"/>
	          <view>网点信息</view>
	        </view>
	        <view class="navitem"  @click="kucunhis()">
	          <image src="https://ayh.wissun.net/static/ayh/dqd/kuncunmx.png" mode="widthFix"/>
	          <view>出入库管理</view>
	        </view>
	        <view class="navitem" @click="xiajifahuo">
	          <image src="https://ayh.wissun.net/static/ayh/dqd/xiajifahuo.png" mode="widthFix"/>
	          <view>下级发货</view>
	        </view>
	        <view class="navitem" @click="saomashouhuo" >
	          <image src="https://ayh.wissun.net/static/ayh/dqd/saomashouhuo.png" mode="widthFix"/>
	          <view>签收入库</view>
	        </view>
	        <view class="navitem" @click="wdzhaomuff"  v-if="userinfo.role != 4">
	          <image src="https://ayh.wissun.net/static/ayh/dqd/wdzhaomu.png" mode="widthFix"/>
	          <view>网点招募</view>
	        </view>
	        <view class="navitem" @click="fahuoshuyuan">
	          <image src="https://ayh.wissun.net/static/ayh/dqd/fahuozs.png" mode="widthFix"/>
	          <view>发货溯源</view>
	        </view>
	        <view class="navitem" @click="tuihuoshenqin">
	          <image src="https://ayh.wissun.net/static/ayh/dqd/tuihuosq.png" mode="widthFix"/>
	          <view>退货申请</view>
	        </view>
			<view class="navitem" @click="wdzhaomu" v-if="userinfo.role > 0">
			  <image src="https://ayh.wissun.net/static/ayh/dqd/wdzhaomu.png" mode="widthFix"/>
			  <view>经销商商城</view>
			</view>
			
			<view class="navitem" @click="duihuan_order" >
			  <image src="https://ayh.wissun.net/static/ayh/dqd/wdzhaomu.png" mode="widthFix"/>
			  <view>兑换订单</view>
			</view>
	    </view>
	    <view class="outlogin" @click="outlogin">退出登录</view>
	  </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username:"",
				authorize_name:"",
				authorize:[],
				userinfo:{},
				fahuo_username:{
					nickname:"明一美优然"
				},
				contact_jxscode:""
			}
		},
		onLoad() {
			this.userinfo=uni.getStorageSync("fahuo_username")
		},
		methods: {
			  //erp 发货
			  erpfahuo(){
			      uni.navigateTo({
			        url: '',
			      })
			  },
			  //库存明细查看
			  kucunhis(){
			      uni.navigateTo({
			        url: '/pages/main/duojifahuo/churuku/index',
			      })
			  },
			  //兑换订单
			  duihuan_order(){
				  uni.navigateTo({
				    url: '/pages/main/duojifahuo/order/index',
				  })
			  },
			   //网点信息
			   wangdianss(){
				  uni.navigateTo({
				  	url:"/pages/main/duojifahuo/wdlist"
				  })
			  },
			  //扫码收货
			  saomashouhuo(){
			    uni.navigateTo({
			      url: '/pages/main/duojifahuo/daiqianshou',
			    })
			  },
			  //下级发货
			  xiajifahuo(){
			    uni.navigateTo({
			      url: '/pages/main/duojifahuo/fahuo/choosewd',
			    })
			  },
			  //零售网点发货
			  fahuolinshou(){
			    uni.navigateTo({
			      url: '/pages/distributor/mendian/wangdian/lsfahuo/index',
			    })
			  },
			  //发货溯源
			  fahuoshuyuan(){
			      uni.navigateTo({
			          url: '/pages/main/duojifahuo/shuyuan',
			      })
			  },
			  //经销商商城
			  wdzhaomu(){
			    uni.navigateTo({
			      url: '/pages/main/duojifahuo/shop/index'
			    })
			  },
			  //网点招募
			  wdzhaomuff(){
			    uni.navigateTo({
			      url: '/pages/main/duojifahuo/wdzhaomu/setp1'
			    })
			  },
			  //退货申请
			  tuihuoshenqin(){
			    uni.navigateTo({
			      url: '/pages/main/duojifahuo/tuihuoappley/main',
			    })
			  },
			  outlogin(){
				  uni.removeStorageSync("fahuo_username");
				  uni.removeStorageSync("fahuo_jxs_token");
				  uni.reLaunch({
				  	url:"/pages/main/duojifahuo/login"
				  })
			  }
		},
	}
</script>

<style>
	page{
	  background-color: #f5f5f5;
	}
	.topicon{
	  text-align: center;
	  width: 100%;
	  height: 211px;
	  background-color: #009688;
	}
	.topicon image{
	  width: 60%;
	  margin:0 auto;
	}
	.tpddiv{
	  
	  display: flex;
	}
	.chkupp{
	  display: flex;
	  justify-content: flex-end;
	  margin-top: 20px;
	  display: none;
	}
	.logopng{
	  width: 50px;
	  height: 50px;
	  margin: 10px;
	}
	.mmname{
	  margin: 10px 0px;
	  overflow: hidden;
	  white-space: nowrap;
	  text-overflow: ellipsis;
	  font-size: 16px;
	}
	.logopng image{
	  width: 100%;
	  border-radius: 50%;
	}
	.userinfobb{
	  background-color: #fff;
	  width: 90%;
	  margin: 0 auto;
	  border-radius: 20px;
	  position: relative;
	  top: -75px;
	  height: 115px;
	}
	.patitle{
	  position: relative;
	  top:-70px;
	  width: 90%;
	  margin: 0 auto;
	}
	.logintime{
	  font-size: 12px;
	  position: absolute;
	  bottom: 10px;
	  left: 10px;
	  color: #333;
	  font-weight: bold;
	}
	.title{
	  margin: 20px 10px;
	  font-weight: bold;
	  font-size: 15px;
	}
	.rihname{
	  width: calc(100% - 100px);
	}
	.tagname{
	  padding: 5px 10px;
	  text-align: left;
	  background-color: #009688;
	  color: #fff;
	  font-size: 12px;
	  border-radius: 20px;
	  width: 106px;
	  display: flex;
	}
	.navitem{
	  width: 25%;
	  float: left;
	  text-align: center;
	  font-size: 14px;
	  font-weight: bold;
	  margin-bottom: 20px;
	}
	.navitem image{
	  width: 60px;
	  height: 60px;
	}
	.outlogin{
	  clear: both;
	  width: 90%;
	  background-color: #009688;
	  text-align: center;
	  height: 40px;
	  line-height: 40px;
	  border-radius: 20px;
	  color: #ffff;
	  margin:0px auto;
	  position: relative;
	  top: 30px;
	}
	.uyy{
	  display:flex;
	  flex-direction: column;
	  text-align: center;
	  justify-content: center;
	  align-items: center;
	
	  font-weight: bold;
	  width: 100px;
	  border-right: 1px solid #eee;
	  
	}
	.font14{
	  font-size: 14px;
	}
	.font16{
	  font-size: 16px;
	}
	.chukunum{
	  display:flex;
	  flex-direction: column;
	  text-align: center;
	  justify-content: center;
	  align-items: center;
	  font-weight: bold;
	  width: 100px;
	}
</style>